<?php
$this->pageTitle = 'Manage Email Template';

$this->menu = array(
    //array('label'=>Yii::t('app', 'List') . ' ' . $model->label(2), 'url'=>array('index')),
    array('label' => Yii::t('app', 'Create') . ' ' . $model->label(), 'url' => array('create')),
);
?>

<h3><?php echo Yii::t('app', 'Manage') . ' ' . GxHtml::encode($model->label(2)); ?></h3>
<script type="text/javascript">
    function ChangeStatus(id, status)
    {  
      	
        $.ajax({
            url: "<?php echo $statuschangeurl; ?>",   
            type: "post", 
            data: "id=" + id + "&status=" + status, 
            dataType:"html",
		
            success: function(msg){
                $('#email-template-grid').yiiGridView.update('email-template-grid');
               
            }
        }); 
  
    } 


</script>

<?php
$this->widget('zii.widgets.grid.CGridView', array(
    'id' => 'email-template-grid',
    'dataProvider' => $model->search(),
    'filter' => $model,
    'columns' => array(
        //'id',
        'name',
        'subject',
        //'body',
        array(
            'name' => 'status',
            'type' => 'raw',
            'value' => 'changeStatusIngridView($data)',
            'filter' => array('0' => Yii::t('app', 'Inactive'), '1' => Yii::t('app', 'Active')),
        ),
        array
            (
            'class' => 'CButtonColumn',
            'template' => '{view}{update}',
        )
    ),
));
?>